package com.kws.merchant.controller;


import com.kws.merchant.domain.OperationRepertoryType;
import com.kws.merchant.service.OperationRepertoryTypeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.*;
import com.kws.common.core.domain.R;

import javax.annotation.Resource;
import java.util.List;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

/**
 * 运维-库存管理备件类型(OperationRepertoryType)表控制层
 *
 * @author yxy
 * @since 2024-10-28 15:39:22
 */
@RestController
@Api(tags = "运维-库存管理备件类型(OperationRepertoryType)")
@RequestMapping("operationRepertoryType")
public class OperationRepertoryTypeController {
    /**
     * 服务对象
     */
    @Resource
    private OperationRepertoryTypeService operationRepertoryTypeService;
 


    @PostMapping("/add")
    @ApiOperation(value = "新增数据")
    public R add(@RequestBody OperationRepertoryType operationRepertoryType) {
        return R.ok(operationRepertoryTypeService.save(operationRepertoryType));
    }

    @PostMapping("/list/{pid}")
    @ApiOperation(value = "下拉列表")
    public R<List<OperationRepertoryType>> listByPid(@PathVariable Long pid) {
        return R.ok(operationRepertoryTypeService.listByPid(pid));
    }

    @PostMapping("/repertoryTypeList")
    @ApiOperation(value = "父子级列表")
    public R< List<OperationRepertoryType>> repertoryTypeList() {
        return R.ok(operationRepertoryTypeService.repertoryTypeList());
    }
}
